<template>
  <el-carousel :interval="2000" type="card" height="200px">
    <el-carousel-item v-for="item in images" :key="item.id" type="card" >
      <img :src="item.image" style="width: 100%; height: 100%" />
    </el-carousel-item>
  </el-carousel>
</template>

<script>
export default {
    name:"Carousel",
    data(){
        return{
                images:[{
                        id:1,
                        image:require('../assets/carousel/1.png')
                    },
                    {
                        id:2,
                        image:require('../assets/carousel/2.jpg'),
                    },
                    {
                        id:3,
                        image:require('../assets/carousel/1.png')
                    },
                    {
                        id:4,
                        image:require('../assets/carousel/2.jpg'),
                    },
                    {
                        id:5,
                        image:require('../assets/carousel/1.png')
                    },
                    {
                        id:6,
                        image:require('../assets/carousel/2.jpg'),
                    }
                ]
        }
    }
}
</script>

<style scoped>
    .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 200px;
        margin: 0;
    }
    
    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }
    
    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }
  
    .backImage{
        background-size:100%
    }
</style>